package cn.bandeqing.orderWorker.entity;

import cn.bandeqing.dispatch.req.DispatchForcePlanReq;
import cn.bandeqing.dispatch.req.DispatchHandleReq;
import cn.bandeqing.dispatch.req.DispatchModifyReq;
import cn.bandeqing.dispatch.req.DispatchPlanReq;
import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 订单排班 实体类。
 *
 * @author fugui
 * @since 2024-01-18
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_order_worker", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMappers({
        @AutoMapper(target = DispatchModifyReq.class, convertGenerate = false),
        @AutoMapper(target = DispatchPlanReq.class, convertGenerate = false),
        @AutoMapper(target = DispatchHandleReq.class, convertGenerate = false),
        @AutoMapper(target = DispatchForcePlanReq.class, convertGenerate = false),
})
public class OrderWorker extends BaseEntity {

    /**
     * ID
     */
    @Id(keyType = KeyType.Auto)
    private Long owId;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 工作人员ID
     */
    private Long workerId;

    /**
     * 0=待接单 1=后台取消 2=后台确认 3=工作人员拒绝 4=工作人员接受 5=超时取消
     */
    private OwStatus owStatus;

    /**
     * 0=实习生 1=收纳师 2=副领队 3=领队
     */
    private OwType owType;

}
